<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户管理</title>
<link href="../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../js/jquery.js"></script>
<script type="text/javascript" src="../../js/sys/users/userList.js"></script>
<script type="text/javascript">
function tipOpen(content) {
	$(".tipright p").text(content);
	$("#tip").fadeIn(200);
}
function tipClose() {
	$("#tip").fadeOut(200);
}
</script>
</head>

<body>
<div class="place"> <span>位置：</span>
  <ul class="placeul">
    <li><a href="#">系统管理</a></li>
    <li><a href="#">用户管理</a></li>
  </ul>
</div>
<div class="rightinfo">
  <form th:action="@{/userManage/userView}" method="post" id="query">
    <ul class="tools">
      <li> <label>员工编号:</label>
        <input name="u_id" type="text" />
      </li>
      <li> <label>员工姓名:</label>
        <input name="uname" type="text" />
      </li>
      <li> <label>所属部门：</label>
        <select name="deptid" id="deptList">

        </select>
      </li>
      <li> <label>状态：</label>
        <select name="statusId">
          <option value="">请选择</option>
          <option value="1">在职</option>
          <option value="2">离职</option>
        </select>
      </li>
      <li class="subBut" onclick="query()"><img src="../../images/t06.png" />查询</li>
      <li class="subBut" onclick="window.location.href='userAdd'"><img src="../../images/t01.png" />添加</li>
    </ul>
    <table class="tablelist">
      <thead>
        <tr>
          <th>序号</th>
          <th>员工编号</th>
          <th>员工姓名</th>
          <th>联系电话</th>
          <th>所属部门</th>
          <th>职位</th>
          <th>性别</th>
          <th>出生日期</th>
          <th>状态</th>
          <th>入职时间</th>
          <th>离职时间</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
      <tr th:each=" u,uStat : ${userList.data}">
        <td th:text="${uStat.count}"></td>
        <td>[[${u.u_id}]]</td>
        <td>[[${u.uname}]]</td>
        <td>[[${u.utelephone}]]</td>
        <td>[[${u.dept.dept_name}]]</td>
        <td>[[${u.job.job_name}]]</td>
        <td th:text="${u.sex}==1?'男':'女'"></td>
        <td th:text="${#dates.format(u.birthday, 'yyyy-MM-dd')}"></td>
        <td th:text="${u.statusId}==1?'在职':'离职'"></td>
        <td th:text="${#dates.format(u.hiredate, 'yyyy-MM-dd HH:mm:ss')}"></td>
        <td th:text="${#dates.format(u.leavedate, 'yyyy-MM-dd HH:mm:ss')}"></td>
        <td>
          <a th:href="@{${'userUpdate'}(u_id=${u.u_id})}" class="tablelink">修改</a>
          <a th:href="@{${'updateStatu'}(u_id=${u.u_id+','+userList.pageNum})}" th:text="${u.statusId}==2?'':'离职'" onclick="tipOpen('您确定此员工离职吗？')"></a>
        </td>
      </tbody>
    </table>
    <div class="pagin">
      <div class="message">共<i class="blue">[[${userList.totalRows}]]</i>条记录，当前显示第&nbsp;<i class="blue">[[${userList.pageNum}]]&nbsp;</i>页</div>
      <ul class="paginList">
        <li class="paginItem" th:if="${userList.pageNum>1}"><a th:href="@{${'userList'}(pageNum=${userList.pageNum-1})}"><span class="pagepre"></span></a></li>
        <li class="paginItem"><a th:href="@{${'userList'}(pageNum=${1})}">1</a></li>
        <li class="paginItem current"><a th:href="@{${'userList'}(pageNum=${2})}">2</a></li>
        <li class="paginItem more"><a href="javascript:;">...</a></li>
        <li class="paginItem"><a th:href="@{${'userList'}(pageNum=${userList.totalPage})}">[[${userList.totalPage}]]</a></li>
        <li class="paginItem" th:if="${userList.pageNum<=userList.totalPage-1}"><a th:href="@{${'userList'}(pageNum=${userList.pageNum+1})}"><span class="pagenxt"></span></a></li>
      </ul>
    </div>
  </form>
  <!-- 提示框 -->
  <div id="tip" class="tip">
    <div class="tiptop"><span>提示信息</span><a onclick="tipClose()"></a></div>
    <div class="tipinfo"> <span><img src="../../images/ticon.png" /></span>
      <div class="tipright">
        <p></p>
        <cite>如果是请点击确定按钮 ，否则请点取消。</cite> </div>
    </div>
    <div class="tipbtn">
      <input name="" type="button"  class="sure" value="确定" onclick="tipClose()" />
      &nbsp
      <input name="" type="button"  class="cancel" value="取消" onclick="tipClose()" />
    </div>
  </div>
</div>
<script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
</script>
</body>
</html>
